# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=ibus-typing-booster
pkgver=2.11.2
pkgrel=1
pkgdesc="Predictive input method for the IBus platform"
url="https://mike-fabian.github.io/ibus-typing-booster/"
arch=(any)
license=(GPL3 Apache)
depends=(ibus python-gobject python-dbus python-pyenchant m17n-lib sqlite)
makedepends=(git)
_commit=2775f38616eddf414a2de8a1a1608ab8a0072c70  # tags/2.11.2
source=("git+https://github.com/mike-fabian/ibus-typing-booster#commit=$_commit")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  autoreconf -fvi
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --libexec=/usr/lib/ibus
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install

  cd "$pkgdir/usr/share/$pkgname/data"
  gzip -nf --best *.{txt,json} annotations{,Derived}/*.xml
}
